<?php
$this->breadcrumbs=array(
	'Clubes'=>array('index'),
	'Gerenciar',
);

$this->menu=array(
	array('label'=>'Listar Clubes','url'=>array('index')),
	array('label'=>'Cadastrar Clube','url'=>array('create'), 'visible'=>Team::model()->findByAttributes(array('owner_id'=> $_SESSION['owner']->id)) == null),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('team-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Gerenciar Clubes</h1>

<?php echo CHtml::link('Pesquisa Avançada','#',array('class'=>'search-button btn')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView',array(
	'id'=>'team-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'owner_id',
		'name',
		'official_name',
		'state',
		'city',
		/*
		'country',
		'street',
		'number',
		'complement',
		'neighborhood',
		'cep',
		'phone',
		'fax',
		'site',
		'email',
		'cnpjl',
		'insertion_date',
		'federation',
		'mandato',
		'agency',
		'account',
		'bank',
		*/
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
		),
	),
)); ?>
